﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Net;
using System.Xml;

using System.ServiceModel;
using System.ServiceModel.Description;

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Discovery;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Metadata;
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Client.Configuration;
using Microsoft.Xrm.Portal;
using Microsoft.Xrm;

using Microsoft.Crm.Sdk.Messages;
using Microsoft.Crm.Services.Utility;

namespace CRM2ORCH
{
    public class Delete
    {
        public OrganizationService service;
        public string message = string.Empty;

        public string deleteEntityByGuid(String entity, String entityGuid)
        {
            try
            {
                Connection conn = new Connection();
                service = conn.setConnection();
                Guid guid = new Guid(entityGuid);
                service.Delete(entity, guid);

            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            return message;
        }

    }
}